<template>
  <div class="edit-container">
    <el-descriptions title="流转详情">
      <el-descriptions-item label="名称">{{form.name}}</el-descriptions-item>
      <el-descriptions-item label="手机号">{{form.phone}}</el-descriptions-item>
      <el-descriptions-item label="流水号">{{form.orderId}}</el-descriptions-item>
      <el-descriptions-item label="记录类型">{{form.typeName}}</el-descriptions-item>
      <el-descriptions-item label="值">
        <div v-if="this.ifVI===1">{{form.voucher}}</div>
        <div v-if="this.ifVI===2">{{form.integral}}</div>
      </el-descriptions-item>
      <el-descriptions-item label="时间">{{form.createTime}}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>
<script>
import {detail} from "@/api/vip";
import {getForm} from "@/utils/utils";

export default {
  components: {},
  props:{
    id:{
      default:null
    },
    ifVI:{
      default:null
    }
  },
  data(){
    return{
      form:{
        id:null,
        name:'',
        phone:'',
        orderId:'',
        typeName:'',
        integral:'',
        voucher:'',
        createTime:'',
      },
      formLoading:false,
      uploads:{
        show:false,
        multiple:true,
      }
    }
  },
  mounted() {
    if(this.id){
      this.getDetail();
    }
  },
  methods:{
    getDetail(){
      this.formLoading=true
      detail(this.id,this.ifVI).then(res=>{
        getForm(res,this.form);
      }).finally(()=>{
        this.formLoading=false;
      })
    },
    close(){
      this.$emit('hideEditDialog')
    }
  }
}
</script>
